<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="ww" uri="webwork" %>

<ww:bean name="'com.css.apps.base.dict.service.DictMan'" id="dictID" />

<form class="form-horizontal table-form" name="zsjDeptForm" id="zsjDeptForm" method="post" action="dirZsjDept.action" 
	onsubmit="return $action.query(this)">
	
	<div class="table-header">
		<div class="table-search">					    
			<ul>
				<li>待同步单位列表（<ww:if test="deptList != null"><ww:property value="deptList.size()"/></ww:if><ww:else>0</ww:else>条）
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					单位名称：<input class="input" type="text" id="orgName" name="orgName" maxlength="256" placeholder="输入单位名称" 
								value="<ww:property value='orgName'/>"></li>
				<li>同步状态：<ww:select attributes="class='input-small'" name="'syncFlag'" id="syncFlag" value="syncFlag" 
							list="#dictID.getDictListQuery('sync_task_type')" listKey="code" listValue="name"></ww:select></li>
				<li>
					<ww:button css="btn btn-sm btn-primary" caption="查询" funcode="acl_zsjuserbase/dirZsjUserBase" type="submit"></ww:button>
				</li>
			</ul>
		</div>
		<div class="table-btn">
			<div class="btn-group">
				<ww:link css="btn btn-default btn-sm" caption="<i class='fa fa-hand-o-up'></i> 同步选中" onclick="$action.execBatch(this,{url:'syncZsjDept.action',title:'确认要进行此操作?'});"></ww:link>
			</div>
			<div class="btn-group">
				<ww:link css="btn btn-default btn-sm" caption="<i class='fa fa-repeat'></i> 全部同步" onclick="$action.exec(this,{url:'syncZsjDept.action?flag=all&syncFlag=%{syncFlag}',title:'确认要进行此操作?'});"></ww:link>
			</div>
		</div>
	</div>
	<table class="table table-bordered" style="margin-bottom: 20px;">
		<thead>
			<tr>
				<th width="25px"></th>
	     	 	<th>单位名称</th>
	     	 	<th>部门名称</th>
	     	 	<th width="180px">上级部门</th>
	     	 	<th width="130px">修改时间</th>
	     	 	<th width="60px">同步状态</th>
			</tr>
		</thead>
		<tbody>
			<ww:iterator value="deptList" id="data" status="data">
		  	<ww:set name="dept" value="deptList[#data.index]" />
				<tr>
					<td class="text-center"><input type="checkbox" name="ids" value="<ww:property value="#dept[0]" />"/></td>
					<!-- 单位名称 -->
					<td><ww:property value="#dept[2]"/></td>
					<!-- 部门名称 -->
					<td><ww:property value="#dept[3]"/></td>
					<!-- 上级部门名称 -->
					<td><ww:property value="#dept[5]"/></td>
					<!-- 修改时间 -->
					<td class="text-center">
						<ww:property value="new java.text.SimpleDateFormat('yy/MM/dd HH:mm:ss').format(#dept[6])"/>
					</td>
					<!-- 同步状态 -->
					<td class="text-center"><ww:property value="#dictID.getDictType('sync_task_type', #dept[7]).name" /></td>
				</tr>
			</ww:iterator>
		</tbody>
	</table>
</form>